package com.paw.security.jwt.domain;

import java.util.HashMap;

import lombok.Data;

/**
 * @author lvzihai
 * @date 2021/7/13
 **/
@Data
public class Result<T> {

  private int code;

  private String message;

  private T content;

  public static <T> Result error (String message) {
    Result<T> result = new Result<>();
    result.setCode(500);
    result.setMessage(message);
    return result;
  }

  public static <T> Result ok (T map) {
    Result<T> result = new Result<>();
    result.setCode(200);
    result.setMessage("success");
    result.setContent(map);
    return result;
  }
}
